﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ManterFormato.aspx.cs" Inherits="ManterFormato" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="demoheading" style="width:400px"> Manter Formato</div>
    <asp:Panel ID="Panel2" runat="server" CssClass="collapsePanelHeader" Height="20px" Width="400px">
       <div style="padding: 5px; cursor: pointer; vertical-align: middle; width: 390px;">
         <div style="float: left;">Consultar Formato</div>
       </div>
    </asp:Panel>    
<div style="width:400">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
       
        <asp:GridView ID="GridView1" runat="server" Width="263px" AllowPaging="True" 
            AutoGenerateColumns="False" DataSourceID="ObjectDataSource1">
            <Columns>
                <asp:BoundField DataField="Codigo" HeaderText="Codigo" 
                    SortExpression="Codigo" />
                <asp:BoundField DataField="Tipo" HeaderText="Tipo" SortExpression="Tipo" />
                <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Atualiza</asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">Remove</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
       
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            DataObjectTypeName="Negocios.Formato" DeleteMethod="Remove" 
            InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="ConsultaTodos" TypeName="Negocios.FormatoBLL" 
            UpdateMethod="Atualiza"></asp:ObjectDataSource>
        <br />
       
    </ContentTemplate>
  </asp:UpdatePanel>
</div>
<br />
<div class="collapsePanelHeader" style="width:400px; height:15px"></div>
<div style="width:400px">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <table style="width: 100%" class="divDados">
            <tr class="divOID">
                <td style="width: 106px">
                    <asp:Label ID="Label5" runat="server" Text="Código"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxCodigo" runat="server" Enabled="False"></asp:TextBox>
                    &nbsp;<asp:Button ID="ButtonNovoFormato" runat="server" Text="Novo Formato" 
                        onclick="Button1_Click" />
                </td>
            </tr>
            <tr>
                <td style="width: 106px">
                    <asp:Label ID="Label4" runat="server" Text="Nome"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxNome" runat="server" Enabled="False"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 106px">
                    <asp:Label ID="Label3" runat="server" Text="Tipo"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownListTipo" runat="server" Enabled="False" 
                        onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                        <asp:ListItem Value="0">Escolha um tipo</asp:ListItem>
                        <asp:ListItem Value="3">3 Audio</asp:ListItem>
                        <asp:ListItem Value="2">2 Video</asp:ListItem>
                        <asp:ListItem Value="1">1 Imagem</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2" style="text-align: center">
                    <asp:Button ID="ButtonGravar" runat="server" Text="Gravar" Enabled="False" 
                        onclick="ButtonGravar_Click" style="height: 26px" />
                    &nbsp;
                    <asp:Button ID="ButtonCancelar" runat="server" Height="26px" Text="Cancelar" 
                        Enabled="False" onclick="ButtonCancelar_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:Label ID="lbErro" runat="server" CssClass="erro"></asp:Label>
    </ContentTemplate>
  </asp:UpdatePanel>
</div>

</asp:Content>

